//
//  BCDateBase.h
//  Memo
//
//  Created by bonc on 13-9-3.
//  Copyright (c) 2013年 fuzhengbang. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDatabase.h"

#define kDateKey @"date"
#define kContentKey @"note"
#define kAlertMode @"AlertMode"

typedef enum {
    BCAlertmodeRing,
    BCAlertModeShake,
    BCAlertModeSoundOff
} BCAlertMode;

@interface BCDateBase : NSObject
@property (strong,nonatomic) FMDatabase* mybase;
+(BCDateBase*)defaultBase;
-(BOOL)openDB;
-(BOOL)closeDB;
//查询某天的所有记录
-(NSArray*)allNotesOnDate:(NSDate*)aDate;
//查询某天的记录总数
-(NSInteger)theNumberOfNotesOnDay:(NSDate*)aDate;
//插入一条新的记录
-(BOOL)insertANewNoteOnTime:(NSDate*)deadline withCotent:(NSString*)content AlertMode:(BCAlertMode) alertMode;
//修改一条记录
-(BOOL)UpdateANoteOnTime:(NSDate*)aDate withContent:(NSString*)content AlertMode:(BCAlertMode)alertMode  toNewContent:(NSString*)newContent andAlertMode:(BCAlertMode)newAlertMode;
//删除一条记录
-(BOOL)deleteANoteOnTime:(NSDate*)aDate withContent:(NSString*)content AlertMode:(BCAlertMode) alertMode;
//删除所有过期的任务
-(BOOL)deleteNotesBeforeTime:(NSDate*)aDate;
//
@end
